const router = require('koa-router')()
let jv = require("libjv").default;
var ObjectId = require('mongodb').ObjectId;

const {logger} = require('../logger');

const jsdom = require("jsdom");
const {JSDOM} = jsdom;

// router.get('/', async (ctx, next) => {
//   await ctx.render('index', {
//     title: 'Hello Koa 2!'
//   })
// })

const mor = require("../libs/mongo/mongoHelper")

router.post('/jd', async (ctx, next) => {
    var now = Date.now();
    //一分钟
    if (global.score_working_start && (new Date(now - global.score_working_start)).Time < 60000) {
        return ctx.error("正在计算，请稍后再试")
    }
    global.score_working_start = now;





    logger.info("计算完成：");

    global.score_working_start = null;
    ctx.body = retJson;
})


module.exports = router
